<?php
declare (strict_types = 1);
/**
 * 素材模型
 */
namespace app\common\model;

class Device extends BaseModel
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 't_device';

    public function deviceList($where = [], $offset = 0, $length = 20) {
        $field = '*';

        $list = self::field($field)->where($where)->limit(($offset) * $length, $length)->select();
        $count = self::where($where)->count('id');
        return [
            'list'  => $list,
            'total' => $count
        ]; 
    }

}
